home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
CITM24.ARJ
/
CITM.DOC
next >
Wrap
Text File
|
1991-03-27
|
6KB
|
145 lines
CITM 2.4
Counts similar
items in sorted lists
by
Bob Eyer
Mar 27, 1991
Files in CITM24.ZIP:
-------------------
CITM.EXE
CITM.DOC
RUN.BAT
COM.DIR
EXE.DIR
If your archive does not contain each of these files, please
inform me (see end of documentation below). Thanks.
Use the RUN.BAT file to run the demo, to see how CITM works on a
couple of examples.
Syntax:
------
CITM Filespec Startpos Width [>Logfile]
Definitions:
-----------
Filespec: The name of the file containing the similar items to be
counted, or a wildcard filespec defining a range of
filenames. CITM now has full wildcard support,
including support for all standard DOS shortcuts.
Startpos: The column number beginning the field containing
similar items which are to be counted. The maximum value
of Startpos is the maximum line length minus Width.
Width: The number of characters in that field. The maximum
which CITM will accept is 18.
Logfile: The resulting list of counts by name of similar item.
If not mentioned, CITM returns its output to the
screen. The new screen default is especially useful in
cases where the number of groups of similar items is
likely to be small.
Purpose:
-------
To count similar items in sorted lists. The test for identity of
item is based on the substring from the input file which is
determined by the Start Position and the Width of that string.
This should also be one of the sort fields used when sorting the
list in preparation for the count.
The value of a program like CITM should be evident chiefly to
users who routinely prepare line-sorted lists of formatted
information, such as BBS Sysops, financial managers,
statisticians, and so on.
Example:
-------
Suppose we wish to determine how many files have been listed by a
BBS in each month of its operation. Most BBS's carry a complete
list of files in which there occur a principal line for each file
containing a date in some sort of standard form. We download that
file and then proceed to sort on the field containing the month
statistic. Usually this will be column 24, and the width of the
field should be 2. However, most BBS's have listings that go back
some number of years. Therefore, it is necessary to use the year
of each listing as the primary sort field. This statistic usually
starts at column 30 with width 2. If we choose to use Baker's
QSORT, the command might go like this:
QSORT BBSLIST /+30:2 /+24:2
This will have the effect of making sure that all similar month
items of each year are consecutively listed.
After this is done, we may then proceed to execute CITM as
follows:
CITM BBSLIST 24 2
Notice that the column position and width correspond exactly with
the sort parameters appropriate to the count listing. The column
and width values given on the CITM command line define the test
for similarity.
To obtain a file listing the information, simply use DOS redirect:
CITM BBSLIST 24 2 >BBSCOUNT
Polishing the Count List
------------------------
The count list (BBSCOUNT in the example above) will contain a list
of counts for each similar string. This list will always appear
in the order in which similar strings occur in the input file.
But the user may wish to sort the count file, as well - say, from
highest to lowest count. Because CITM's output is formatted, such
a 'polishing' sort can be done without difficulty.
Effect of the use of wildcards
------------------------------
This new version of CITM supports wildcard Filespecs, and so
allows the user to obtain count summaries on whole directories
containing sorted lists. For this purpose, CITM always records
the name of the file read into memory at the top of each count
list, for identification purposes.
To see how wildcards affect output, simply execute the RUN batch
file in the present archive.
CITM's use of wildcards also covers all standard DOS wildcard
shortcuts. So, if you have many text files of the same type and
format in one directory called TEST, and you are in TEST's parent,
you may obtain all the count reports for each file simply by
entering a command like:
CITM TEST Startpos Width
This will generate as many formatted count reports as there are
properly formatted files in the TEST subdirectory.
DISCLAIMER:
==========
This program is circulated as freeware without any guarantee or
warranty; and the user, by downloading this program, or any
variant thereof or by receiving it or any of its versions in any
other form, agrees to accept full responsibility for its use. It
is therefore understood that the user accepts this program or any
previous version as is.
Bob Eyer The author may also be reached at
Compuserve [73230,2620] ROSE MEDIA 416-733-2285 (Main Conf)
Toronto or
Canada CANADA REMOTE 416-629-7044 (IBM Conf)
-------------------------------------------------------------
End of documentation.